<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>layout 后台大布局 - Layui</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <link rel="stylesheet" href="/static/admin/css/common.css">
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">layui 后台布局</div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item"><a href="">控制台</a></li>
            <li class="layui-nav-item"><a href="">商品管理</a></li>
            <li class="layui-nav-item"><a href="">用户</a></li>
            <li class="layui-nav-item">
                <a href="javascript:;">其它系统</a>
                <dl class="layui-nav-child">
                    <dd><a href="">邮件管理</a></dd>
                    <dd><a href="">消息管理</a></dd>
                    <dd><a href="">授权管理</a></dd>
                </dl>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img src="http://t.cn/RCzsdCq" class="layui-nav-img">
                    贤心
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="">基本资料</a></dd>
                    <dd><a href="">安全设置</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="">退了</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree"  lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">所有商品</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;">列表一</a></dd>
                        <dd><a href="javascript:;">列表二</a></dd>
                        <dd><a href="javascript:;">列表三</a></dd>
                        <dd><a href="">超链接</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">解决方案</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;">列表一</a></dd>
                        <dd><a href="javascript:;">列表二</a></dd>
                        <dd><a href="">超链接</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item"><a href="">云市场</a></li>
                <li class="layui-nav-item"><a href="">发布商品</a></li>
            </ul>
        </div>
    </div>

    <div class="layui-body body-main">
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief" style="margin: 0px;">
            <ul class="layui-tab-title">
                <li class="layui-this" lay-id="1">管理员列表</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <blockquote class="layui-elem-quote layui-text">
                        <div class="layui-row">
                            <div class="layui-inline layui-col-md2">
                                <button class="layui-btn add_admin">
                                    <i class="layui-icon"></i> 添加管理员
                                </button>
                            </div>
                        </div>
                        <div class="layui-row" style="margin-top: 15px;">
                            <div class="layui-inline layui-col-md2">
                                <div class="layui-input-inline">
                                    <input type="text" name="username" autocomplete="off" class="layui-input" placeholder="用户名">
                                </div>
                            </div>
                            <div class="layui-inline layui-col-md1">
                                <button class="layui-btn">
                                    搜索
                                </button>
                            </div>
                        </div>
                    </blockquote>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-main">
                <div class="layui-form">
                    <table class="layui-table" lay-even="" lay-skin="row">
                        <colgroup>
                            <col width="150">
                            <col width="150">
                            <col width="150">
                            <col width="200">
                            <col>
                        </colgroup>
                        <thead>
                        <tr>
                            <th>用户名</th>
                            <th>邮箱</th>
                            <th>手机</th>
                            <th>最后登录时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {empty name="data"}
                            <tr>
                                <td colspan="6" align="center">暂无数据</td>
                            </tr>
                        {else /}
                            {volist name="data" id="vo"}
                                <tr>
                                    <td>{$vo.username}</td>
                                    <td>{$vo.email}</td>
                                    <td>{$vo.mobile}</td>
                                    <td>{$vo.last_login_time}</td>
                                    <td></td>
                                </tr>
                            {/volist}
                        {/empty}
                        </tbody>
                    </table>
                    <div>
                        {$data->render()|raw}
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © layui.com - 底部固定区域
    </div>
</div>
<script src="/static/layui/layui.js"></script>
<script>
    layui.config({
        base : "/static/js/"
    }).use(['form','layer','jquery','common','carousel', 'element'], function () {
        var $ = layui.jquery,
            form = layui.form,
            common = layui.common,
            carousel = layui.carousel;

        $(".add_admin").click(function () {
            save_admin(0);
        });

        // ** 添加管理员
        function save_admin(_id) {
            var _title = '添加管理员';
            var _url = '{:url("save_admin")}';
            if (_id) {
                _title = '编辑管理员';
                _url = '{:url("save_admin")}?id=' + _id;
            }
            common.cmsLayOpen(_title,  _url, '800px', '800px');
        }
    });
</script>
</body>
</html>